﻿using System.Collections.Generic;
using MiniWeb.Core.Dtos;
using MiniWeb.Core.Entities;
using MiniWeb.Dao;
using WFramework.MvcPager;

namespace MiniWeb.Task
{
    /// <summary>
    ///
    /// </summary>
    public class AdminUserTask
    {
        private readonly AdminUserDao _adminUser = new AdminUserDao();

        public void Add(AdminUser model)
        {
            _adminUser.Add(model);
        }

        public void Update(AdminUser model)
        {
            _adminUser.Update(model);
        }

        public void Delete(int id)
        {
            _adminUser.Delete(id);
        }

        public bool Exits(string userName)
        {
            return _adminUser.Exits(userName);
        }

        public AdminUser GetById(int id)
        {
            return _adminUser.GetById(id);
        }

        public AdminUser GetByUserName(string userName)
        {
            return _adminUser.GetByUserName(userName);
        }

        public PagedList<AdminUser> GetPagedList(string account, int pageIndex, int pageSize)
        {
            return _adminUser.GetPagedList(account, pageIndex, pageSize);
        }

        public List<AdminUser> GetListByNoAdmin()
        {
            return _adminUser.GetListByNoAdmin();
        }
    }
}

